home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
amac44a.zip
/
MIS003.QM
< prev
next >
Wrap
Text File
|
1992-05-27
|
14KB
|
292 lines
* mis003.qm
* Macros To Make Column Blocks of Longest Lines
* Written By Tom Hogshead
* [ See MISCxx.QM For Use ]
* 5/19/92
* Key Subfile Description
* ===== ========== ====================================================
* Make Block a Column Block of Longest Line
* @(3) ├─ Exclude Leading Spaces |chg
* @(1) ├─ Include Leading Spaces |chg
* @(7) └─ Include Leading Spaces (Use Nul, small ver of @1)
*
* Make Paragraph a Column Block of Longest Line
* @(5) ├─ Exclude Leading Spaces
* @(2) └─ Include Leading Spaces |chg
*
* Make 20 Tab Stop Wide Column Block,
* @(8) └─ Exclude Leading Spaces |new
*
* @(6) Make File a Column Block of Longest Line
* @(4) Make a 73 Column Wide Column Block |chg
*
* Convert Column Blocks . .
* #(f3) Convert Vertical to Horizontal Column Block
* #(f4) Convert Horizontal to Vertical Column Block
* #(f5) Convert Vertical to Horizontal Column Block,
* Horizontal Entries NOT Separated by Space
* #(f6) Convert Horizontal to Vertical Column Block,
* Horizontal Entries NOT Separated by Space
*
* #(F4__) {e:\up\com003} Surround Column-Blocked Text With
* Box Of Desired Characters
* ********
* Box Drawn *Around* Outside Border
* ********
* Of Column Block, Juxtapose Text
*
* @(F4) {e:\up\com003} Erase Outside Border Of Column-Blocked Text
* and Collapse Text Surronding Block To Original
* Position Before Box Was Made
*
* Macros to Right/Left Justify and Align . .
* @(1) {e:\up\rfr004} Right Justify Column Block
* @(2) {e:\up\rfr004} Left Justify Column Block
* @(3) {e:\up\rfr004} Align Column Block By Decimal Point
* @(4) {e:\up\rfr004} Align Column Block By Decimal Point, Fill Zeros
* @(5) {e:\up\rfr004} Comma Delineate and Align Column Block By
* Decimal Point, Fill With Zeros
* @(6) {e:\up\rfr004} Comma Delineate and Align Column Block By
* Decimal Point, Fill With Zeros, Add $'s
* @(9) {e:\up\rfr004} Right Justify Column
* @(f1) {e:\up\rfr004} Right Justify Line or Block Using RJ.COM
* @(f2) {e:\up\rfr004} Removes Right Justification From Line or Block
* @(f3) {e:\up\rfr004} Right Justify FILE Using RJ.COM
* @(f4) {e:\up\rfr004} Removes Right Justification From FILE
* @(f5) {e:\up\rfr004} Right Justify FILE Using RJ.COM, Screen Preview
* @(f8) {e:\up\rfr004} Left Justify File
* @(f7) {e:\up\rfr004} Left Justify Lines Containing Any Type Block
* Sort Column Block And Adjacent Text In:
* @(1) {e:\up\rfr009} Ascending Absolute Value
* @(2) {e:\up\rfr009} Descending Absolute Value
* @(3) {e:\up\rfr009} Ascending, Case Insensitive
* @(4) {e:\up\rfr009} Descending
* @(5) {e:\up\rfr009} Reverse
*
* Sort Column Block Only In:
* @(6) {e:\up\rfr009} Ascending Absolute Value
* @(7) {e:\up\rfr009} Descending Absolute Value
* @(8) {e:\up\rfr009} Ascending, Limited to 999 Lines
* @(9) {e:\up\rfr009} Descending
* @(0) {e:\up\rfr009} Randomly
*
* {e:\up\MISC*} Return To MISCxx.QM
*
*-- eoi
* M A C R O S
* ----------------------------------------------------------------------
* @(1) Make Column Block of Longest Line, Pause To Mark Block,
* Include Leading Spaces
* ----------------------------------------------------------------------
* Have you ever needed to mark a column block to include all the text
* in each line and no trailing spaces after the longest line? If so,
* this macro may help.
* I found myself often having to:
* - mark block begin
* - cursor down to longest line
* - endline
* - cursor down to block end
* - close block
* This macro automates and does this, and also will convert an open or
* closed line, character or column block to a column block of the width
* of the longest line in the block.
* At the 'pause', cursor down to select lines, and press <enter> to make a
* column block of the longest lines selected. Alternatively, lines may
* be marked as an open or closed line, character or column before macro
* execution. Macro requires QEdit v2.15.
@1 macrobegin
gotoblockbeg jtrue A markline gotoblockbeg jtrue OK pause jump B
A: gotoblockend unmarkblock markline prevposition
B: markline
OK: setscreenoff
gotoblockend begline addline "*" #173 gotoblockbeg begline markcolumn
1: endline cursorleft markcolumn cursordown
Find "*" #173 return delline return jfalse 2 prevposition *|
jump 1
2: delline gotoblockbeg
*
* 74 bytes Sat 11-02-1991 17:45:48 (TH @1, #3/758
* 70 bytes Mon 11-11-1991 12:04:28 (TH @1, changed routine)
* 67 bytes Wed 11-20-1991 09:43:07 (TH @1, shortened, #3/774)
* 63 bytes Sat 12-07-1991 14:28:09 (TH @1, shortened)
* 64 bytes Sun 04-26-1992 12:07:14 (TH @1, added setscreenoff)
* 54 bytes Tue 04-28-1992 08:11:14 (TH @1, shortened, changed labels)
*
* ----------------------------------------------------------------------
* @(2) Make Column Block of Longest Line in Paragraph,
* Include Leading Spaces
* ----------------------------------------------------------------------
* This macro will make a paragraph a column block of longest line in
* paragraph.
@2 macrobegin
setscreenoff
endpara prevpara
begline unmarkblock markcolumn endline
1: cursorleft markcolumn cursordown begline endline jtrue 1
gotoblockbeg
* 31 bytes Sat 11-02-1991 17:45:51 (TH @2, #3/758 as @5)
* 24 bytes Sun 11-10-1991 16:25:36 (TH @2, shortened)
* 23 bytes Wed 11-20-1991 09:25:50 (TH @2, shortened #3/774)
* 19 bytes Sat 12-07-1991 14:35:32 (TH @2, shortened, mark all para)
* 19 bytes Sun 04-26-1992 11:28:45 (TH @2, changed start)
* 20 bytes Sun 04-26-1992 12:08:39 (TH @2, include setscreenoff )
* 20 bytes Tue 04-28-1992 08:22:19 (TH @2, changed labels)
*
* ----------------------------------------------------------------------
* @(3) Make Column Block Longest Line, Exclude Leading Spaces
* ----------------------------------------------------------------------
* This macro works like @1 except the column width is equal to the
* actual text length of the longest line in the marked block excluding
* leading spaces.
* At the 'pause', cursor down to select lines, and press <enter> to make a
* column block of the longest lines selected. Alternatively, lines may
* be marked as an open or closed line, character or column before macro
* execution. Macro requires QEdit v2.15.
* See @f8 in rfr003.qm for example using this macro.
@3 macrobegin
gotoblockend jtrue A markline gotoblockend jtrue OK pause jump B *|
A: gotoblockbeg unmarkblock markline prevposition *|
B: markline *|
OK: setscreenoff
1: begline addline "*" #173 gotoblockbeg *|
2: isemptyline jfalse 3 cursordown jump 2
3: firstnonwhite markcolumn endline cursorleft
4: cursordown isemptyline jtrue 4 isendline jtrue 5 endline cursorleft
5: markcolumn Find "*" #173 return delline return jfalse 6
prevposition firstnonwhite iscursorinblock jtrue 4 markcolumn jump 4
6: delline gotoblockbeg
*
* 75 bytes Mon 11-11-1991 12:04:12 (TH @3)
* 87 bytes Wed 11-20-1991 11:14:52 (TH @3, corrected for empty lines #3/774)
* 79 bytes Sat 04-25-1992 13:42:48 (TH @3, shortened, changed labels)
* 77 bytes Tue 04-28-1992 08:03:29 (TH @3, shortened)
*
* ----------------------------------------------------------------------
* @(4) Convert Any Type Block to Column Block 73 Column Wide,
* Include Leading Spaces
* ----------------------------------------------------------------------
* This macro will convert any type open or closed block to 73 column
* wide column block. Change 73 to any desired width. Single line
* blocks are excluded.
@4 macrobegin setscreenoff
gotoblockbeg jtrue A markline gotoblockbeg jtrue A
unmarkblock jump END
A: begline gotoblockend prevposition markcolumn *|
prevposition gotocolumn "73" return markcolumn gotoblockbeg
END:
*
* 54 bytes Thu 11-07-1991 22:44:08 (TH @4 #3/758 as @2)
* 32 bytes Sun 11-10-1991 19:05:38 (TH @4, shortened, #3/774)
* 31 bytes Tue 04-28-1992 08:28:45 (TH @4, shortened)
*
* ----------------------------------------------------------------------
* @(5) Make Column Block of Longest Line in Paragraph,
* Exclude Leading Spaces
* ----------------------------------------------------------------------
* This macro will make a paragraph a column block of longest line in
* paragraph. See @f9 in rfr003.qm for example using this macro.
@5 macrobegin savesettings setautoindentmode setsoundoff
setscreenoff
endpara prevpara * Move to para begin
firstnonwhite * Pos first char current line
unmarkblock markcolumn * Start column block
endline cursorleft * Make line 1 column block
1: cursordown jfalse 3 * Move down to next line
isemptyline jtrue 4 *ELSE not eof, test if end of para
markcolumn *ELSE not end of para, extend block
firstnonwhite * Move to first char
iscursorinblock jtrue 2 * Test if in block
markcolumn *ELSE not in block, extend block
gotoblockend cursorleft * Pos to test if past eol
2: isendline jtrue 1 * Test if past eol, loop again if true
endline cursorleft jump 1 *ELSE inlcude eol in block, loop again
3:
4: gotoblockbeg * Pos block begin
restoresettings
*
* 43 bytes Sun 04-26-1992 12:05:29 (TH @5)
*
* ----------------------------------------------------------------------
* @(6) Make Column Block of Longest Line in File,
* Include Leading Spaces
* ----------------------------------------------------------------------
* This macro will make a file a column block of longest line in the
* file. This technique is primarily for use in other macros like in @7
* and @0 in MSGxx.QM.
@6 macrobegin
setscreenoff *|
begfile unmarkblock markcolumn
1: endline cursorleft markcolumn cursordown jtrue 1
begfile
*
* 22 bytes Tue 11-19-1991 23:40:49 (TH @6, #3/774)
* 18 bytes Sat 12-07-1991 14:39:44 (TH @6, shortened)
* 16 bytes Sun 04-26-1992 12:09:50 (TH @6, include setscreenoff, shortened)
*
* ----------------------------------------------------------------------
* @(7) Make Column Block of Longest Line in Column or Character Block,
* Use Nul, Include Leading Spaces
* ----------------------------------------------------------------------
* This macro will make a column block of the longest line in a column
* or character block. It will not work with line blocks. This
* technique is used in dsiz@1.qm @1.
@7 macrobegin
setscreenoff
editfile "nul" return quit gotoblockbeg jfalse END
editfile return
copyblock unmarkblock markcolumn
1: endline cursorleft markcolumn cursordown jtrue 1
copy quit pasteover
END:
*
* 33 bytes Sun 04-26-1992 14:46:38 (TH @7)
*
* ----------------------------------------------------------------------
* @(8) Make Column Block 20 Tab Stops Wide, Exclude Leading Spaces
* ----------------------------------------------------------------------
* At the 'pause', cursor down to select lines, and press <enter> to
* make a 20 Tab stop wide column block excluding leading spaces.
* Alternatively, lines may be marked as an open or closed line,
* character or column before macro execution.
* The same block marking could be achieved using "gotocolumn nn
* return", but this macro is intended to not change the last entry in
* the "goto column" prompt. Macro requires QEdit v2.15.
@8 macrobegin setinsmode toggleinsert
gotoblockend jtrue A markline gotoblockend jtrue OK pause jump B *|
A: gotoblockbeg unmarkblock markline prevposition *|
B: markline *|
OK: setscreenoff
1: begline addline "*" #173 gotoblockbeg *|
2: isemptyline jfalse 3 cursordown jump 2
3: tabrt 20 markcolumn firstnonwhite markcolumn
4: cursordown isemptyline jtrue 4
Find "*" #173 return delline return jfalse 6
prevposition firstnonwhite markcolumn jump 4
6: delline gotoblockbeg
*
* 76 bytes Mon 04-27-1992 15:43:06 (TH @8)
* 74 bytes Tue 04-28-1992 08:36:52 (TH @8, shortened)